<template>
  <div class="users">
   <ul>
       <li v-for="user in users" :key="user.id" v-on:click="user.show=!user.show ">
           <!-- {{user}} -->
           <h2>{{user.name}}</h2>
           <h3 v-show="user.show">{{user.position}}</h3>
       </li>
   </ul>
  </div>
</template>
<script>
export default {
  name: 'users',
  data () {
    return {
     users:[
       {name:"小明",position:"开发者",show:false},
       {name:"小明",position:"开发者",show:false},
       {name:"小明",position:"开发者",show:false},
       {name:"小明",position:"开发者",show:false},
       {name:"小明",position:"开发者",show:false},
       {name:"小明",position:"开发者",show:false},
       {name:"小明",position:"开发者",show:false},
       {name:"小明",position:"开发者",show:false},
       {name:"小明",position:"开发者",show:false},
       {name:"小明",position:"开发者",show:false},
       {name:"小明",position:"开发者",show:false}
       
     ]
   
    }
  },
}


</script>
<style scoped>
.users{
  width: 100%;
  max-width: 1200px;
  margin: 40px auto;
  /* height: 400px; */
  box-sizing: border-box;  
}
ul{
  display: flex;
  flex-wrap: wrap;
}
li{
    flex-grow: 1;
    list-style: none;
    flex-basis: 200px;
    margin: 10px;
    border: 1px solid #ccc;
    text-align: center;
}
</style>
